<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>客户信息管理</title>
	<script type="text/javascript" src="http://localhost/myweb/Static/hdjs/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="http://localhost/myweb/Static/hdjs/hdjs.css"/>
    <script type="text/javascript" src="http://localhost/myweb/Static/hdjs/hdjs.min.js"></script>
</head>
<body>
	<div class="hd-menu-list">
		<ul>
			 <li class="active"><a href="<?php echo U('index');?>" > 客户信息列表 </a></li>
			 <li><a href="<?php echo U('add');?>"> 添加客户信息 </a></li>
		</ul>
	</div>
	<table class="hd-table hd-table-list">
		<tr>
			<th>ID</th>
			<th>客户姓名</th>
			<th>客户电话</th>
			<th>备注信息</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>
		        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($customer)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($customer as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($customer)-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
			<tr>
				<td><?php echo $v['id'];?></td>
				<td><?php echo $v['name'];?></td>
				<td><?php echo $v['phone'];?></td>
				<td><?php echo $v['remark'];?></td>
				<td><?php echo date('Y-m-d H:i:s',$v['addtime']);?></td>
				<td>
					[<a href="<?php echo U(edit,array('id'=>$v[id]));?>">修改</a>]
					[<a href="<?php echo U(del,array('id'=>$v[id]));?>">删除</a>]
				</td>
			</tr>
		<?php }}?>
	</table>
	<div class="hd-page">
		<?php echo $page;?>
	</div>
</body>
</html>